﻿@model GitCandy.Models.SettingModel

@{
    ViewBag.Title = string.Format(SR.Shared_TitleFormat, SR.Setting_EditTitle);
}

<h4>@SR.Setting_EditTitle</h4>


@using (Html.BeginForm("Edit", "Setting", FormMethod.Post))
{
    <dl class="dl-horizontal col-md-8">
        <dt>@Html.DisplayNameFor(s => s.IsPublicServer)</dt>
        <dd>
            <div class="switch" data-on-label="@SR.Shared_Yes" data-off-label="@SR.Shared_No">
                @Html.CheckBoxFor(s => s.IsPublicServer, new { data_size = "small" })
            </div>
        </dd>

        <dt>@Html.DisplayNameFor(s => s.ForceSsl)</dt>
        <dd>
            <div class="switch" data-on-label="@SR.Shared_Yes" data-off-label="@SR.Shared_No">
                @Html.CheckBoxFor(s => s.ForceSsl, new { data_size = "small" })
            </div>
        </dd>

        <dt>@Html.DisplayNameFor(s => s.EnableSsh)</dt>
        <dd>
            <div class="switch" data-on-label="@SR.Shared_Yes" data-off-label="@SR.Shared_No">
                @Html.CheckBoxFor(s => s.EnableSsh, new { data_size = "small" })
            </div>
        </dd>

        <dt>@Html.DisplayNameFor(s => s.SslPort)</dt>
        <dd>@Html.TextBoxFor(s => s.SslPort, new { @class = "form-control" })</dd>

        <dt>@Html.DisplayNameFor(s => s.SshPort)</dt>
        <dd>@Html.TextBoxFor(s => s.SshPort, new { @class = "form-control" })</dd>


        <dt>@Html.DisplayNameFor(s => s.LocalSkipCustomError)</dt>
        <dd>
            <div class="switch" data-on-label="@SR.Shared_Yes" data-off-label="@SR.Shared_No">
                @Html.CheckBoxFor(s => s.LocalSkipCustomError, new { data_size = "small" })
            </div>
        </dd>

        <dt>@Html.DisplayNameFor(s => s.AllowRegisterUser)</dt>
        <dd>
            <div class="switch" data-on-label="@SR.Shared_Yes" data-off-label="@SR.Shared_No">
                @Html.CheckBoxFor(s => s.AllowRegisterUser, new { data_size = "small" })
            </div>
        </dd>

        <dt>@Html.DisplayNameFor(s => s.AllowRepositoryCreation)</dt>
        <dd>
            <div class="switch" data-on-label="@SR.Shared_Yes" data-off-label="@SR.Shared_No">
                @Html.CheckBoxFor(s => s.AllowRepositoryCreation, new { data_size = "small" })
            </div>
        </dd>

        <dt>@Html.DisplayNameFor(s => s.RepositoryPath)</dt>
        <dd>@Html.TextBoxFor(s => s.RepositoryPath, new { @class = "form-control" })</dd>

        <dt>@Html.DisplayNameFor(s => s.CachePath)</dt>
        <dd>@Html.TextBoxFor(s => s.CachePath, new { @class = "form-control" })</dd>

        <dt>@Html.DisplayNameFor(s => s.GitCorePath)</dt>
        <dd>@Html.TextBoxFor(s => s.GitCorePath, new { @class = "form-control" })</dd>

        <dt>@Html.DisplayNameFor(s => s.NumberOfCommitsPerPage)</dt>
        <dd>@Html.TextBoxFor(s => s.NumberOfCommitsPerPage, new { @class = "form-control" })</dd>

        <dt>@Html.DisplayNameFor(s => s.NumberOfItemsPerList)</dt>
        <dd>@Html.TextBoxFor(s => s.NumberOfItemsPerList, new { @class = "form-control" })</dd>

        <dt>@Html.DisplayNameFor(s => s.NumberOfRepositoryContributors)</dt>
        <dd>@Html.TextBoxFor(s => s.NumberOfRepositoryContributors, new { @class = "form-control" })</dd>

        @if (!ViewData.ModelState.IsValid)
        {
        <dt></dt>
        <dd>@Html.ValidationSummary(true, SR.Setting_UpdateSettingsUnsuccessfull, new { @class = "alert alert-dismissable alert-danger" })</dd>
        }

        <dt></dt>
        <dd>
            <button type="submit" class="btn btn-primary">@SR.Shared_Save</button> &nbsp;
            <button type="reset" class="btn btn-inverse">@SR.Shared_Reset</button> &nbsp;
            @Html.ActionLink(SR.Setting_ReGenSsh, "ReGenSsh", null, new { @class = "btn btn-danger" }) &nbsp;
            @Html.ActionLink(SR.Shared_Restart, "Restart", null, new { @class = "btn btn-danger" }) &nbsp;
        </dd>
    </dl>
}
